package com.kly.sc.api.application.controller.user.request;

import com.fqgj.common.api.ParamsObject;
import com.kly.sc.api.infras.exception.ApplicationException;

import java.util.Objects;

/**
 * 用户喜欢
 * @author linqu
 */
public class WlmUserRequest extends ParamsObject {

    /**
     * 当前页数
     */
    private Integer pageNum;

    /**
     * 每页条数
     */
    private Integer pageSize;

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        if (pageSize == null) {
            this.pageSize = 10;
        } else {
            this.pageSize = pageSize;
        }
    }

    @Override
    public void validate() {

        if (Objects.isNull(this.pageNum)) {
            throw new ApplicationException("The params: pageNum should not be empty");
        }

    }
}
